/**
 * 
 */
package com.rst.common.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @author JavaDeamon
 *
 */
@MappedSuperclass
public class CommonDetailsTable {

	private String createdAuthor;
	private Date createdDate;
	private String updatedAuthor;
	private Date updatedDate;
	private Integer version;
	
	
	/**
	 * @return the createdAuthor
	 * userId of user who had created the entity
	 * field cannot be null
	 * maximum length will be 50 characters
	 */
	@Column(name="CREATER", nullable=false, length=50)
	public String getCreatedAuthor() {
		return createdAuthor;
	}
	/**
	 * @return the createdDate
	 * timestamp at which CREATER had created the entity
	 * field cannot be null
	 * the value stored in the field is of type timestamp
	 */
	@Column(name="CREATED_TIMESTAMP", nullable=false)
	@Temporal(TemporalType.TIMESTAMP)
	public Date getCreatedDate() {
		return createdDate;
	}
	/**
	 * @return the updatedAuthor
	 * userId of user who had updated the entity
	 * field can be null
	 * maximum length will be 50 characters
	 */
	@Column(name="UPDATER", length=50)
	public String getUpdatedAuthor() {
		return updatedAuthor;
	}
	/**
	 * @return the updatedDate
	 * timestamp at which UPDATER had updated the entity
	 * field can be null
	 * the value stored in the field is of type timestamp
	 */
	@Column(name="UPDATED_TIMESTAMP")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getUpdatedDate() {
		return updatedDate;
	}
	/**
	 * @return the version
	 * field for storing version of entity(initial value will be 1)
	 * value will be incremented by 1 as the entity is updated
	 * the field cannot be null and have a default value as 1
	 */
	@Column(name="VERSION", nullable=false, columnDefinition="integer default 1")
	public Integer getVersion() {
		return version;
	}
	
	/**
	 * @param createdAuthor the createdAuthor to set
	 */
	public void setCreatedAuthor(String createdAuthor) {
		this.createdAuthor = createdAuthor;
	}
	/**
	 * @param createdDate the createdDate to set
	 */
	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}
	/**
	 * @param updatedAuthor the updatedAuthor to set
	 */
	public void setUpdatedAuthor(String updatedAuthor) {
		this.updatedAuthor = updatedAuthor;
	}
	/**
	 * @param updatedDate the updatedDate to set
	 */
	public void setUpdatedDate(Date updatedDate) {
		this.updatedDate = updatedDate;
	}
	/**
	 * @param version the version to set
	 */
	public void setVersion(Integer version) {
		this.version = version;
	}
	
	
}
